﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Kojarskiy.Core;

namespace Kojarskiy
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("Login",
                "login/",
                new { controller = "Account", action = "Login", id = UrlParameter.Optional, language = "ru" });

            routes.MapRoute("Sitemap",
                "sitemap.xml",
                new { controller = "Home", action = "SiteMap", id = UrlParameter.Optional, language = "ru" });

            routes.MapRoute(
                name: "LanguageLocalization",
                url: "{language}/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
                );

            routes.MapRoute(
                name: "DefaultLocalization",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, language = "ru" }
                );
        }

    }
}